function load(operation) {
		var htmlobj;
		htmlobj=$.ajax({url:"/sweetns/index.php/stream/"+operation,async:true,beforeSend:function(){
			$('#main_content').html("<img id='loading' src='../../images/loading.gif'></img>");
		},success:function(){
			$('#main_content').html(htmlobj.responseText);
			$('div .sweet').mouseover(function(){
				$(this).addClass('hover');
			}).mouseout(function(){
				$(this).removeClass('hover');
		});
		}});
}
	$(document).ready(function(){
		load("feed");
		
		/*发布状态发动面板 */
		var panel_tag = false;
		$('#form_panel').mouseover(function(){
			panel_tag=true;
		}).mouseout(function(){
			panel_tag=false;
		});
		
		$("div#left_item_1").click(function(){load("feed");});
		
		$('#leftcontent ul:first').show('slow');
		$('#leftcontent   div').click(function(){
			$('#leftcontent ul').hide("fast");
			var n = $("#leftcontent div").index(this);
			$('#leftcontent   ul:eq('+n+')').show("slow");
		});
		$('#leftcontent li').mouseover(function(){
			
			$(this).addClass('mouseover');
		});
		$('#leftcontent li').mouseout(function(){
			$(this).removeClass('mouseover');
		});
		$('#leftcontent li').click(function(){
			$name=$(this).attr("name");
			$('#leftcontent li').removeClass();
			$(this).addClass('selected');
			var y = $(this).offset().top;
			/*$('#triangle_pointer').animate({top:y},'slow');*/
			$('div.middle_components').hide('normal',function(){
				$('#triangle_pointer').offset({top:y});
				$("div .sweet").hide();
				$("div ."+$name).show();
			}).show('2000');
			
		});
		$("li#feedlong").click(function(){load("feedLong")});
		$("li#feedlink").click(function(){load("feedLink")});
		$('#publish_editor').focus(function(){
			
			$('#form_panel').slideDown("fast");
		}).blur(function(){
			if(panel_tag==false){
				$('#form_panel').slideUp("fast");
			}
		});
		$('#update_button').wrapInner('<span class="hover"></span>').each(function(){
			$('#update_button span').css('opacity',0).hover(function(){
				$(this).fadeTo(650,1);
			},function(){
				$(this).fadeTo(650,0);
			});
		});
		$('#update_button').click(function(){
			$('#form_panel').slideUp("fast");
			var content = $("#publish_editor").val();
			$("div#form_panel input:checked").each(function(){
				var s = $(this).val();
				//alert(content + s);
				$.post("/sweetns/index.php/stream/update", {status: content, services: s}, function(data){
					$("div#updatesuccess").fadeIn(1000).fadeOut(1000);
				});
			
			});
		});
		$('div .sweet').mouseover(function(){
			$(this).addClass('hover');
		}).mouseout(function(){
			$(this).removeClass('hover');
		});
		$('#middle-middle-middle').jScrollPane(
			{
			showArrows: false,
			autoReinitialise: true
			}
		);
		
		$.ajax({url:"/sweetns/index.php/stream/profile",async:true,beforeSend:function(){
		},success:function(data){
			$(data).find("h1").each(function(){
				var step=0;
				var type=$(this).attr("name");
				$("#profile ul").append("<li><img src='../../images/tab_"+type+".png'></li>");
				var string="<div id='"+type+"_profile' class='clearfix'><div id='profile_avatar'>";/*</div><div id='profile_detail'></div></div>";*/
			/*	$("#profile").append("<div id='"+type+"_profile' class='clearfix'><div id='profile_avatar'></div><div id='profile_detail'></div></div>");*/
				$(this).find("div").each(function(){
					switch(step){
						case 0:
						/*	$("#profile_avatar").html("<img src='"+$(this).text()+"'>");*/
							string=string+"<img src='"+$(this).text()+"'>"+"</div><div id='profile_detail'>";
						break;
						case 1:
						/*	$("#profile_detail").append($(this).text());*/
							string=string+"账户类型："+type+"<br>用户："+$(this).text()+"<br>服务状态：已绑定</div></div>";
						break;
					}
					step++;
				});
				$("#profile").append(string);
				$("#profile>div:gt(0)").css("display","none");
				$("#profile li:first").addClass("selected");
				$("#profile li").click(function(){
					$("#profile li").removeClass("selected");
					$(this).addClass("selected");
					var n=$("#profile li").index(this);
					$("#profile>div").hide();
					$("#profile>div:eq("+n+")").show();
					
				});
				$("#profile li").mouseover(function(){
					$(this).addClass("hover");
				}).mouseout(function(){
					$(this).removeClass("hover");
				});
				
			});
	
		}});
		$("div#profile_tittle").toggle(function(){
						$("#profile").slideUp();
						$(this).css({"border-bottom":"2px solid rgba(168,182,216,0.6)","border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"});
					},function(){
						$("#profile").slideDown();
						$(this).css({"border-bottom":"0px solid rgba(168,182,216,0.6)","border-bottom-left-radius":"0px","border-bottom-right-radius":"0px"});
				/*	alert("");
					var n=$("#right_container>div").index(this)+1;
					$("#profile").toggle(function(){
						$(this).slideUp();
					},function(){
						$(this).slideDown();
					});*/
				});
		
	});